SET(JSC_SOURCES
    ../jsc.cpp
)

SET(JSC_LIBRARIES
    ${WTF_LIBRARY_NAME}
    ${JavaScriptCore_LIBRARY_NAME}
)

IF ("${JavaScriptCore_LIBRARY_TYPE}" MATCHES "STATIC")
    ADD_DEFINITIONS(-DSTATICALLY_LINKED_WITH_JavaScriptCore)
ENDIF ()

WEBKIT_INCLUDE_CONFIG_FILES_IF_EXISTS()

WEBKIT_WRAP_SOURCELIST(${JSC_SOURCES})
INCLUDE_DIRECTORIES(./ ${JavaScriptCore_INCLUDE_DIRECTORIES})
ADD_EXECUTABLE(${JSC_EXECUTABLE_NAME} ${JSC_SOURCES})
TARGET_LINK_LIBRARIES(${JSC_EXECUTABLE_NAME} ${JSC_LIBRARIES})
SET_TARGET_PROPERTIES(${JSC_EXECUTABLE_NAME} PROPERTIES FOLDER "JavaScriptCore")

IF (JSC_LINK_FLAGS)
    ADD_TARGET_PROPERTIES(${JSC_EXECUTABLE_NAME} LINK_FLAGS "${JSC_LINK_FLAGS}")
ENDIF ()

IF (SHOULD_INSTALL_JS_SHELL)
    INSTALL(TARGETS ${JSC_EXECUTABLE_NAME} DESTINATION "${EXEC_INSTALL_DIR}")
ENDIF ()
